/**
 * 跨省通办 调用基础服务的区划数据api
 */
import request from "@/utils/request";

/**
 * 获取顶级区划数据
 */
export function queryAllFirstLevelSysDistrict() {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/common/sysDistrict/queryAllFirstLevelSysDistrict`,
    method: "post"
  });
}

/**
 * 根据附件父级区划oid 查询下级集合数据
 */
export function querySysDistrictListByParentOid(parentOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/common/sysDistrict/querySysDistrictListByParentOid/${parentOid}`,
    method: "post"
  });
}

/**
 * 根据code查询区划数据
 * @param {*} code
 */
export function querySysDistrictByCode(code) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/common/sysDistrict/querySysDistrictByCode/${code}`,
    method: "post"
  });
}

/**
 * 根据省级oid查询市、区县的简单树形数据
 * @param {*} districtOid
 */
export function queryTreeByDistrictOid(districtOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/common/sysDistrict/queryTreeByDistrictOid/${districtOid}`,
    method: "post"
  });
}
